1. Field of the Invention
The present invention relates to an image reading apparatus for reading a document image, a method of controlling the same, and a control program.
2. Description of the Related Art
FIG. 1 is a schematic block diagram of the configuration of an image reading apparatus 200.
In FIG. 1, the image reading apparatus 200 is connected to a host computer 100, and is controlled by the host computer 100. Images from the image reading apparatus 200 are displayed by the host computer 100, and are saved therein.
The host computer 100 includes a CPU (central processing unit) 101 for performing various operations, a RAM (random access memory) 102 which is used as a work area by an operating system or programs, a hard disk 103 for storing the operating system and the programs, a monitor 104, an input device 105 including a mouse and a keyboard, and an interface unit 106 for connecting the host computer 100 to an external device of the image reading apparatus 200.
The interface unit 106 comprises a serial interface, a parallel interface, a SCSI (small computer serial interface), a USB (universal serial bus) interface, and an IEEE 1394 interface.
The image reading apparatus 200 includes a contact image sensor (hereinafter referred to as xe2x80x9cCISxe2x80x9d) 201, LEDs (light emitting diodes) 202 used as light sources, an LED control circuit 203, an amplifier 204, an analog-to-digital (A/D) converter circuit 205, a shading RAM 206, a shading correction circuit 207, a peak detecting circuit 208, a gamma conversion circuit 209, a buffer RAM 210, a packing/buffer RAM control circuit 211, an interface circuit 212, a motor drive circuit 213, and a motor 214.
FIG. 2 illustrates the configuration of a program stored in the host computer 100 for controlling the image reading apparatus 200. The program includes a TWAIN (Technology Without Any Interested Name) compatible application 301, a TWAIN driver 302, a device driver 303, a port driver 304, and an operating system (OS) 305.
The packing/buffer RAM control circuit 211 controls the motor 214 and the buffer RAM 210 in the following way:
Image data output from the packing/buffer RAM control circuit 211 is written to the buffer RAM 210, and the image data written is read from buffer RAM 210 to the host computer 100 via the interface circuit 212. If a speed at which data is written from the packing/buffer RAM control circuit 211 to the buffer RAM 210 is higher than a speed at which the data is read by the host computer 100 from the RAM 210, the buffer RAM 210 encounters an overflow. The packing/buffer RAM control circuit 211 checks an available space of the buffer RAM 210, and instructs the motor drive circuit 213 to stop reading the image data when the available space equals the amount of one line of the image data. When the buffer RAM 210 becomes empty again, the packing/buffer RAM control circuit 211 instructs the motor drive circuit 213 to resume reading.
Such an operation to avoid an overflow of the buffer RAM 210 is called a start/stop operation (hereinafter referred to as xe2x80x9cSSxe2x80x9d). When SS is effected, the reading may be resumed either at the stop position of the CIS 210 or at a position back from the stop position. If the reading is resumed at the stop position, the image may discontinue at the stop position, thereby causing degradation of image quality. If the reading is resumed at a position back from the stop position, an extra time is required before the reading can be resumed, thereby making the overall scan time slower. Such inconveniences are inevitable if SS is caused, and it is therefore necessary to minimize SS as much as possible.
Since the driving speed of the motor 214 is proportional to a speed at which the data is written to the buffer RAM 210, the device driver 303 conventionally controls the speed of the motor 214 so that a speed at which the data is written to the buffer RAM 210 from the packing/buffer RAM control circuit 211 is lower than a speed at which the data is read from the buffer RAM 210 by the host computer 100, and so that the data is written to the buffer RAM 210 at the highest speed in the above condition.
The speed of the motor 214 is controlled, assuming that the host computer 100 reads image data from the buffer RAM 210 at a constant rate. If the reading of data by the host computer 100 is interrupted, the buffer RAM 210 becomes full, thereby causing SS.
One possible reason why the reading of data by the host computer 100 is interrupted is swapping of memories. When an image is being read, the TWAIN driver 302 reserves a work area having the same size as the size of the image. If an available space of the RAM 102 is greater than the image size, the RAM 102 is used for the work area. If an available space of the RAM 102 is smaller than the image size, the work area that cannot be stored in the available space of the RAM 102 becomes a virtual memory for which the memory of the hard disk 103 is used. If the work area allocated to the hard disk 103 is accessed, swapping of memories occurs. The swapping might cause data which is being read by the host computer 100 to be interrupted depending upon the performance of the hard disk 103.
Accordingly, it is an object of the present invention to provide an image reading apparatus which prevents degradation of image quality and a delay in the image reading time which are caused by interruption of reading of image data, and to provide a method of controlling the image reading apparatus.
To achieve the above object, the method of and the apparatus for reading images according to the present invention is constituted as follows.
An image reading apparatus includes: an image reading unit having a photoelectric conversion component for reading light from an image and converting the read image to an image signal; a driving motor for moving the image reading unit and the image relative to each other; a motor control unit for controlling the driving motor; an interface connecting to an external information processing device; a conversion circuit for performing analog-to-digital conversion on the image signal into image data; a memory connected to the interface for storing the image data; and a control signal receiving unit for receiving a motor control signal via the interface. The control signal receiving unit receives the motor control signal which controls the driving motor so as to satisfy the relationship V1xe2x89xa6V2, where V1 represents a data speed at which the image is read to generate the image data, and V2 represents a data speed at which the image signal read out via the interface is stored in the information processing device as one piece of image data. The motor control unit controls the driving motor according to the received motor control signal.
An image reading system includes an image reading apparatus, and an information processing apparatus. The image reading apparatus includes: an image reading unit having an photoelectric conversion component for reading light from an image and converting the read image to an image signal; a driving motor for moving the image reading unit and the image relative to each other; a motor control unit for controlling the driving motor; a conversion circuit for performing analog-to-digital conversion on the image signal into image data; and an image memory for storing the image data. The information processing apparatus includes: a temporary storage memory for reading and temporarily storing the image data stored in the image memory; a first timer for measuring the speed of the data stored in the temporary storage memory; and a control signal generating unit for outputting a motor control signal to the motor control unit based on the measurement of the first timer. The motor control unit controls the driving motor according to the motor control signal output by the control signal generating unit.
A controlling method for controlling an image reading system includes the steps of: reading image data at a predetermined read speed to generate image data; storing the image data in storage means; reading out the image data stored in the storage means via an interface; temporarily storing the image data, which is read out in the reading out step, in a temporary storage memory; and detecting a speed at which the temporary storage memory temporarily stores the image data. The read speed in the reading step is controlled according to the speed detected in the detecting step.
A method of controlling an image reading includes the steps of: reading an image and generating image data; transmitting the generated image data; processing the transmitted image data; and measuring a processing speed of the image data in the processing step. The reading of the image is controlled so that a speed at which the image data is generated in the image data generating step is lower than the processing speed measured in the measuring step.
Further objects, features and advantages of the present invention will become apparent from the following description of the preferred embodiments with reference to the attached drawings.